<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR" import="java.sql.*"%>

<%
	String sId = request.getParameter("id");
	String sPwd = request.getParameter("pwd");
	String sName = request.getParameter("name");
	String sEmail = request.getParameter("email");
	String sAddress = request.getParameter("addr");
	String sJob = request.getParameter("job");
	String sSex = request.getParameter("sex");
	
	String DB_URL = "jdbc:mysql://localhost:3306/bbs";
	String DB_USER = "root";
	String DB_PASSWORD = "dmsruf81";
	
	Statement stmt;
	String query = "insert into logon (ID,PASSWORD,NAME,EMAIL,ADDRESS,JOB,SEX,MOMENT) VALUES('"+sId+"','"+sPwd+"','"+sName+"','"+sEmail+"','"+sAddress+"','"+sJob+"','"+sSex+"',now())";
	
	try{
		Class.forName("com.mysql.jdbc.Driver");
		Connection conn = DriverManager.getConnection(DB_URL,DB_USER,DB_PASSWORD);
		stmt = conn.createStatement();
		
		stmt.executeUpdate(query);
		
		stmt.close();
		conn.close();
		
		response.sendRedirect("Login.jsp");
		
	}catch(Exception e){e.printStackTrace();}
%>